<template>
  <v-app id="root-div">
    <v-main>
      <Notifications></Notifications>
      <TopBar></TopBar>
      <UploadProgress/>
        <router-view/>
    </v-main>
  </v-app>
</template>

<script>
import Notifications from "@/components/views/common/Notifications/Notifications";
import TopBar from "@/components/views/common/TopBar";
import UploadProgress from '@/components/UploadProgress.vue';
export default {
  name: 'App',
  components: {TopBar,
	Notifications,
    UploadProgress,
  },
  data: () => ({
    //
  }),
  mounted() {
    //在页面加载时读取sessionStorage里的状态信息
    if (sessionStorage.getItem("store") ) {
      this.$store.replaceState(Object.assign({}, this.$store.state,JSON.parse(sessionStorage.getItem("store"))))
    }

    //在页面刷新时将vuex里的信息保存到sessionStorage里
    window.addEventListener("beforeunload",()=>{
      sessionStorage.setItem("store",JSON.stringify(this.$store.state))
    })
  }
};
</script>

<style>
/*引入全局css*/
@import "./style/index.css";

#root-div{
  width: 100vw;
}
#router-wrapper {
  /*height: calc(100vh - 78px);*/
}
</style>
